package com.wust.smartcity.admin.server.core.api.feign.server;

import com.wust.smartcity.admin.server.core.dao.SysDataSourceMapper;
import com.wust.smartcity.common.annotations.FeignApi;
import com.wust.smartcity.common.dto.WebResponseDto;
import com.wust.smartcity.common.entity.sys.datasource.SysDataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@FeignApi
@RequestMapping("/api/feign/v1/DataSourceFeignApi")
@RestController
public class DataSourceFeignApi {
    @Autowired
    private SysDataSourceMapper sysDataSourceMapper;

    @RequestMapping(value = "/select",method= RequestMethod.POST)
    public WebResponseDto select(@RequestBody SysDataSource search) {
        WebResponseDto responseDto = new WebResponseDto();
        List<SysDataSource> dataSources = sysDataSourceMapper.select(search);
        responseDto.setLstDto(dataSources);
        return responseDto;
    }
}
